package com.example.demo.day.config.learn.design.factory.x2;

public class Factory {

    public static final String SUV = "suv";
    public static final String MPV = "mpv";

    public CarFactory create(String type) {
        switch (type) {
            case SUV:
                return new SuvCarFactory();
            case MPV:
                return new MpvCarFactory();
            default:
                throw new RuntimeException("NO " + type + " car factory" );
        }
    }
}
